import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import React from 'react';
import CheckPermissions from "./CheckPermissions";

var Authorized = /*#__PURE__*/function (_React$Component) {
  _inherits(Authorized, _React$Component);

  var _super = _createSuper(Authorized);

  function Authorized() {
    _classCallCheck(this, Authorized);

    return _super.apply(this, arguments);
  }

  _createClass(Authorized, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          children = _this$props.children,
          authority = _this$props.authority,
          _this$props$noMatch = _this$props.noMatch,
          noMatch = _this$props$noMatch === void 0 ? null : _this$props$noMatch;
      var childrenRender = typeof children === 'undefined' ? null : children;
      return CheckPermissions(authority, childrenRender, noMatch);
    }
  }]);

  return Authorized;
}(React.Component);

export default Authorized;